Hello there.
Welcome to this javascript comments video indeed feed your I will explain what jabba's group comments
does and also provide an example of the two types of javascript comments.
So what is javascript comments are what are Jabr script comments.
What javascript comments are used to explain parts of a code of a javascript code.
So is a good practice to have comments in your code.
Course this will help you down the road later.
Why are you not sure what parts of the code does.
BALDWIN There are comments in the court.
He will guide you or remind you us to what those block are.
Parts of the code does it.
Oz saw is a good practice because you may have in future.
Others may want to look at the code you you've written.
If there are comments on them it will help them understand the code better.
Javascript commands can also use usses candle testin or troubleshooting tool.
So if you are no test set in part of the code and you don't want set parts to to execute or run you
can use comments to block out that those parts of the code and them test the other parts.
Those are some of the ways you can use javascript comments and there are two main types of javascript
comments you got the single line comments.
Wade appears just on the single line of the of the court and they go on multiple like comet which will
comment out a block of code.
Someone's going to show you couple of example one of this single line comment and one on the multiple
line comments.
All right this is the simple web page I created in the previous videos.
I've been working with some When I used to be because the hasty email caught on this web page to illustrate
how javascript comments work right.
I'll start with a single line comment if single line comments are place on the right side on the code.
Then each will comment had all the cord or parts of the court and that part will not be displayed when
the browser loads.
So start with a single line comment only.
Done using two slashes.
That's why you need two slashes.
And his comment about orval are this line of could sway.
I say that and run this page you'll only get this part of the javascript tape and display coalesced
to let the run launch in Chrome.
A gun was loaded it page content and then this part of the javascript which is the second part of the
code right says exit that arise for is.
Ignore that and display that.
So what if I want Bull's code excluded.
I don't want any javascript to load on this page at all so I'll do that using a multiple line comment.
You do that with a slash an asterix
And then as serax then a slash
symbol.
All right.
So anything in between the Asterix will not be displayed by the browser so should cause have been commented
out.
So the browser will display no javascript on this piece of board jabb Us group soup statements on this
page will be ignored by the browser.
Because of this mortar pull line comment.
So I saved that and run that in Chrome.
There should be no javascript.
You see that is just low that the page content without any javascript at all.
So this is how you would write a multiple line comments.
He can also play single line comments on the right hand side of the court so if single line comments
are placed on the right side the chord will still run.
But the comment itself will not be displayed so let's put a single line comment here doubles laughs.
Just explain what that part of the code does.
All right Sovs expend this battle because by saying these walls show an alleged box so I'll comment
out this one so that we can see the effect more on the first one.
So the first part will display because a comment is on the right second part.
Well not because the comment is on the left.
Our quick run luncheon Crow.
They got the that's the first part.
Show me the money and that's the content.
Okay so this part of this play is part dead and so if this scripted single line comments are left be
called will not execute Fice on the right.
The code will display.
So this is an example of multiple and single line comments in this video.
I have explained what Jav as quick comment dance and the benefits of using javascript comments.
I showed an example of his single line comments and the multiple line comment also showed the effect
of placing a single line comment on the right hand side of the jabaar scroop coat when this is done.
He will give a description on the code and the code will still run.
I hope the video as being useful.
You can practice inserting comments inside that same CML coat.
Thank you so much for watching.
Bye for now.